package com.hg.junit.spring.chapter1;

import com.hg.junit.Bean.MyBean;
import com.hg.junit.Bean.MyBeanConfig;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {MyBeanConfig.class})
//@ActiveProfiles("prod")
@ActiveProfiles("dev")
public class Chapter1 {

    @Autowired
    private MyBean bean;

    @Test
    public void testBean() {
        System.out.println(bean.toString());
        Assert.assertEquals(bean.getName(), "james");
        System.out.println("hello");
        System.out.println("hello");
        //Assert.assertEquals(bean.getName(),"kobe");
    }
}
